package com.one.group.model.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 维修记录表实体类
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SuppressWarnings("all")
@Table(value = "sp_repair_record") // 映射数据库表名
public class RepairRecord implements Serializable {

    @Id // 标识主键字段
    @Column(value = "id") // 指定数据库列名
    private Long id; // 主键ID

    @Column(value = "tenant_id", tenantId = true)
    private Long tenantId; // 租户ID（关联 sp_tenant 表）

    @Column(value = "equipment_id")
    private Long equipmentId; // 设备ID（关联 sp_equipment 表）

    @Column(value = "repair_order_number")
    private Long repairOrderNumber;

    @Column(value = "repair_count")
    private Integer repairCount; // 维修次数（默认0）

    @Column(value = "repair_project")
    private String repairProject; // 维修项目

    @Column(value = "repairer")
    private String repairer; // 维修人

    @Column(value = "repair_time")
    private LocalDateTime repairTime; // 维修时间

    @Column(value = "repair_hours")
    private Integer repairHours; // 维修工时

    @Column(value = "repair_cost")
    private BigDecimal repairCost; // 维修费用（decimal 类型）

    @Column(value = "fault_details")
    private String faultDetails; // 故障详情

    @Column(value = "processing_status")
    private String processingStatus; // 处理情况

    @Column(value = "is_deleted", isLogicDelete = true)
    private Integer isDeleted; // 逻辑删除标记（0-未删除，1-删除）

    @Column(value = "create_time")
    private LocalDateTime createTime; // 创建时间

    @Column(value = "update_time")
    private LocalDateTime updateTime; // 更新时间
}
